<?php
// -----------------------------------------------------------------------------

include "../../config/config.php";
include "../../auth.php";
include "../../DBManager.php";

// -----------------------------------------------------------------------------

if (!(isset($_POST['content']) && isset($_POST["id"]))) {
    exit("需要传入有效的参数。");
}

$id = $_POST['id'];
$content = $_POST['content'];

// -----------------------------------------------------------------------------

$dbPath = "../../" . $dbPath;
$db = new DBManager("sqlite:" . $dbPath);

// -----------------------------------------------------------------------------

try {
    $db->writeToPurchased($id, $content);
} catch (Exception $e) {
    echo $e->getMessage();
}
